import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileInputstreamDemo1 {
    public static void main(String[] args) throws IOException {

        FileOutputStream fos = new FileOutputStream("MyFile\\src\\tmp\\fis1.txt");
        fos.write("Hello".getBytes());
        fos.write("\n".getBytes());
        fos.write("Java".getBytes());
        fos.write("\n".getBytes());
        fos.write("hei ma it".getBytes());
        fos.write("\n".getBytes());
        fos.close();


        FileInputStream fis = new FileInputStream("MyFile\\src\\tmp\\fis1.txt");

        int by ;
        while((by = fis.read()) != -1){
            System.out.print((char)by);
        }
        fis.close();
    }
}
